package com.dingwen.consumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 *
 *
 * @author dingwen
 *  LoadBalanced: 开启RestTemplate 的负载均衡 机制
 * 2021.07.05 14:18
 */
@Configuration
public class ApplicationContextConfig {


    @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
